package org.campuscontent.model;

import org.jgraph.graph.DefaultGraphModel;
import org.jgraph.graph.Edge;

public class AutomataModel extends DefaultGraphModel
{
    private boolean undoDisabled = true;

    public boolean getUndoable()
    {
        return undoDisabled;
    }

    public void setUndoable( boolean undoable )
    {
        undoDisabled = undoable;
    }

    // Override Superclass Method
    public boolean acceptsSource( Object edge, Object port )
    {
        // Source only Valid if not Equal Target
        return (((Edge) edge).getTarget() != port);
    }

    // Override Superclass Method
    public boolean acceptsTarget( Object edge, Object port )
    {
        // Target only Valid if not Equal Source
        return (((Edge) edge).getSource() != port);
    }
    
    
}
